package com.ranjiaqi.upload;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ClassName ServerSocket
 * @Description TODO
 * @Author hp
 * @Date 2021/7/4 18:26
 * @Version 1.0
 **/
public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8888);
        ExecutorService executorService = Executors.newFixedThreadPool(6);
        while (true){
            Socket accept = serverSocket.accept();
            executorService.submit(new SocketRunnable(accept));
        }
    }
}
